package com.example.rabbitdemo.exchanger.direct;

import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class OrderConsumer {
    // 监听名为 "queue.order" 的队列
    @RabbitListener(queues = "queue.order")
    public void handleOrderMessage(String message) {
        System.out.println("订单消费者收到消息: " + message);
        // 这里处理你的订单业务逻辑
    }

    @RabbitListener(queues = "queue.payment")
    public void handlePaymentMessage(String message) {
        System.out.println("fufei消费者收到消息: " + message);
        // 这里处理你的订单业务逻辑
    }
}